package com.winit.projectPlan.model;

import com.winit.attachment.model.Attachment;
import com.winit.commons.util.SeqGenerate;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;
import java.io.Serializable;
import java.util.Date;
import java.util.List;

@Entity
@Table(name = "matrix_project_plan")
@DynamicInsert
@DynamicUpdate

@ApiModel(value="projectPlan",description="projectPlan对象")
public class ProjectPlan implements Serializable {
    @Id
    @Column(name = "project_plan_id")
    private String projectPlanId;

    @Column(name = "project_plan_name")
    private String projectPlanName;

    @Column(name = "project_plan_charger_account")
    private String projectPlanChargerAccount;

    @Column(name = "project_plan_charger_realname")
    private String projectPlanChargerRealname;

    @Column(name = "project_plan_creater_account")
    private String projectPlanCreaterAccount;


    @Column(name = "project_plan_creater_realname")
    private String projectPlanCreaterRealname;


    @Column(name = "project_plan_create_time")
    private Date projectPlanCreateTime;

    @Column(name = "project_plan_status")
    private String projectPlanStatus;

    @Column(name = "project_plan_desc")
    private String projectPlanDesc;


    @Column(name = "project_plan_is_del")
    private String projectPlanIsDel;

    /**
     * 启动日期
     */
    @Column(name = "project_plan_startup_time")
    private Date projectPlanStartupTime;

    /**
     * 启动日期
     */
    @Column(name = "project_plan_online_time")
    private Date projectPlanOnlineTime;

    /**
     * 业务线
     */
    /** 2017-12-01 */
    @Column(name = "project_plan_business")
    private Date projectPlanBusiness;

    @ApiModelProperty(hidden = true)
    @OneToMany
    @JoinColumn(name="attachment_owner_id")
    List<Attachment> attachments;

    @Transient
    List<String> attachmentIds;

    @Column(name = "project_plan_no")
    private String projectPlanNo;

    //对接beetle plan
    @Column(name = "uplan_id")
    private String uplanId ;
    @Column(name = "project_plan_code")
    private String projectPlanCode;
    @Column(name = "project_plan_pdm_account")
    private String projectPlanPdmAccount;
    @Column(name = "project_plan_pdm_realname")
    private String projectPlanPdmRealname;
    @Column(name = "risk")
    private String risk;

    /**
     * 调用beetle plan用
     */
    @Transient
    private String tokenId;

    /**
     * 保存在beetle plan中的团队成员
     */
    @Transient
    private String memebers;

    @Transient
    private List<String> reqIds;

    public List<String> getAttachmentIds() {
        return attachmentIds;
    }

    public void setAttachmentIds(List<String> attachmentIds) {
        this.attachmentIds = attachmentIds;
    }

    public List<Attachment> getAttachments() {
        return attachments;
    }

    public void setAttachments(List<Attachment> attachments) {
        this.attachments = attachments;
    }

    public String getProjectPlanId() {
        return projectPlanId;
    }

    public Date getProjectPlanStartupTime() {
        return projectPlanStartupTime;
    }

    public void setProjectPlanStartupTime(Date projectPlanStartupTime) {
        this.projectPlanStartupTime = projectPlanStartupTime;
    }

    public Date getProjectPlanOnlineTime() {
        return projectPlanOnlineTime;
    }

    public void setProjectPlanOnlineTime(Date projectPlanOnlineTime) {
        this.projectPlanOnlineTime = projectPlanOnlineTime;
    }

    public void setProjectPlanId(String projectPlanId) {
        this.projectPlanId = projectPlanId;
    }

    public String getProjectPlanName() {
        return projectPlanName;
    }

    public void setProjectPlanName(String projectPlanName) {
        this.projectPlanName = projectPlanName;
    }

    public String getProjectPlanChargerAccount() {
        return projectPlanChargerAccount;
    }

    public void setProjectPlanChargerAccount(String projectPlanChargerAccount) {
        this.projectPlanChargerAccount = projectPlanChargerAccount;
    }

    public String getProjectPlanChargerRealname() {
        return projectPlanChargerRealname;
    }

    public void setProjectPlanChargerRealname(String projectPlanChargerRealname) {
        this.projectPlanChargerRealname = projectPlanChargerRealname;
    }

    public String getProjectPlanCreaterAccount() {
        return projectPlanCreaterAccount;
    }

    public void setProjectPlanCreaterAccount(String projectPlanCreaterAccount) {
        this.projectPlanCreaterAccount = projectPlanCreaterAccount;
    }

    public String getProjectPlanCreaterRealname() {
        return projectPlanCreaterRealname;
    }

    public void setProjectPlanCreaterRealname(String projectPlanCreaterRealname) {
        this.projectPlanCreaterRealname = projectPlanCreaterRealname;
    }

    public Date getProjectPlanCreateTime() {
        return projectPlanCreateTime;
    }

    public void setProjectPlanCreateTime(Date projectPlanCreateTime) {
        this.projectPlanCreateTime = projectPlanCreateTime;
    }

    public String getProjectPlanStatus() {
        return projectPlanStatus;
    }

    public void setProjectPlanStatus(String projectPlanStatus) {
        this.projectPlanStatus = projectPlanStatus;
    }

    public String getProjectPlanDesc() {
        return projectPlanDesc;
    }

    public void setProjectPlanDesc(String projectPlanDesc) {
        this.projectPlanDesc = projectPlanDesc;
    }

    public String getProjectPlanIsDel() {
        return projectPlanIsDel;
    }

    public void setProjectPlanIsDel(String projectPlanIsDel) {
        this.projectPlanIsDel = projectPlanIsDel;
    }

    public List<String> getReqIds() {
        return reqIds;
    }

    public void setReqIds(List<String> reqIds) {
        this.reqIds = reqIds;
    }

    public Date getProjectPlanBusiness() {
        return projectPlanBusiness;
    }

    public void setProjectPlanBusiness(Date projectPlanBusiness) {
        this.projectPlanBusiness = projectPlanBusiness;
    }

    public String getProjectPlanNo() {
        return projectPlanNo;
    }

    public void setProjectPlanNo(String projectPlanNo) {
        this.projectPlanNo = projectPlanNo;
    }

    public String getUplanId() {
        return uplanId;
    }

    public void setUplanId(String uplanId) {
        this.uplanId = uplanId;
    }

    public String getProjectPlanCode() {
        return projectPlanCode;
    }

    public void setProjectPlanCode(String projectPlanCode) {
        this.projectPlanCode = projectPlanCode;
    }

    public String getTokenId() {
        return tokenId;
    }

    public void setTokenId(String tokenId) {
        this.tokenId = tokenId;
    }

    public String getMemebers() {
        return memebers;
    }

    public void setMemebers(String memebers) {
        this.memebers = memebers;
    }

    public static final String generateProjectPlanNo(){
        return "FBY" + SeqGenerate.createSerialNo();
    }

    public String getProjectPlanPdmAccount() {
        return projectPlanPdmAccount;
    }

    public void setProjectPlanPdmAccount(String projectPlanPdmAccount) {
        this.projectPlanPdmAccount = projectPlanPdmAccount;
    }

    public String getProjectPlanPdmRealname() {
        return projectPlanPdmRealname;
    }

    public void setProjectPlanPdmRealname(String projectPlanPdmRealname) {
        this.projectPlanPdmRealname = projectPlanPdmRealname;
    }

    public String getRisk() {
        return risk;
    }

    public void setRisk(String risk) {
        this.risk = risk;
    }
}
